﻿using lBLL;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Model;

namespace WebApplication145.Controllers
{
    [Route("api/[controller]")]
    [ApiController]
    public class USerController : ControllerBase, lUserBLL
    {
        private readonly lUserBLL db;

        public USerController(lUserBLL db)
        {
            this.db = db;
        }
        [HttpPost("AddAsync")]
        public Task<int> AddAsync(Userinfor userinfor)
        {
            return db.AddAsync(userinfor);
        }
        [HttpDelete("DeleteAsync")]
        public Task<int> DeleteAsync(int id)
        {
            return db.DeleteAsync(id);
        }
        [HttpGet("GetAllAsync")]
        public dynamic GetAllAsync(string? name, DateTime? time, int? dq)
        {
            return db.GetAllAsync(name,time,dq);
        }
        [HttpPut("UpdateAsync")]
        public Task<int> UpdateAsync(Userinfor userinfor)
        {
            return db.UpdateAsync(userinfor);
        }
    }
}
